package com.wy.statusbar;

import android.content.Context;
import android.util.AttributeSet;
import android.widget.ScrollView;

/**
 * Time:8/23/21
 * Author:ypf
 * Description:
 */
public class MyScollView extends ScrollView {
    public MyScollView(Context context) {
        super(context);
    }

    public MyScollView(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    public MyScollView(Context context, AttributeSet attrs, int defStyleAttr) {
        super(context, attrs, defStyleAttr);
    }


    @Override
    protected void onScrollChanged(int l, int t, int oldl, int oldt) {
        super.onScrollChanged(l, t, oldl, oldt);
        if (scrollChangerListener != null) {
            scrollChangerListener.onScroll(l, t, oldl, oldt);
        }
    }

    public interface ScrollChangerListener {
        void onScroll(int l, int t, int oldl, int oldt);
    }

    ScrollChangerListener scrollChangerListener;

    public void setScrollChangerListener(ScrollChangerListener scrollChangerListener) {
        this.scrollChangerListener = scrollChangerListener;
    }
}
